package org.yenn.pattern.aliyun.j2ee.compositeentity;

import lombok.ToString;

/**
 * @Author: yerenyun
 * @Description:步骤 4
 * 创建使用组合实体的客户端类。
 */
@ToString
public class Client {
    private CompositeEntity compositeEntity = new CompositeEntity();

    public void printData() {
        System.out.println(compositeEntity);
        for (String cgo : compositeEntity.getData()) {
            System.out.println("CoarseGrainedObject::DependentObject?::Data: " + cgo);
        }
    }

    public void setData(String data1, String data2) {
        compositeEntity.setData(data1, data2);
    }
}